<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 因为父级需要占有位置，因此是相对定位， 子盒子不需要占有位置，则是绝对定位 */
        .box1 {
            position: absolute;
            top: 55px;
            left: 34px;
            height: 50px;
            width: 30px;
            background-color: pink;
        }

        .box2 {
            position: relative;
            top: 0px;
            left: 0px;
            height: 200px;
            width: 200px;
            background-color: #f600ff;
        }
    </style>
</head>

<body>
    <div class="box2">
        <div class="box1"></div>
    </div>

</body>

</html>